/*
 * Copyright (c) 2002-2004, xRhino, Inc.
 *
 * This library is free software; you can redistribute and/or modify
 * it under the terms of the dual license distributed with this source
 * package (a combined Trolltech QPL/GPL-compatible license)
 *
 * Under this dual license scheme, a separate license is available for use of 
 * this code with a proprietary (closed) system. For more information on the 
 * license, please see the LICENSE file distributed with this source package.
 */
#ifndef SUGMATRIX_H
#define SUGMATRIX_H

#include "SugTypes.h"

/**
 * The matrix manipulation class.  This is a direct translation of the SVG 
 * IDL.
 */
class SugMatrix
{
  protected:
   /**
    * The A element of the matrix
    */
    SugRealType mA;

   /**
    * The B element of the matrix
    */
   SugRealType mB;

   /**
    * The C element of the matrix
    */
   SugRealType mC;

   /**
    * The D element of the matrix
    */
   SugRealType mD;

   /**
    * The E element of the matrix
    */
   SugRealType mE;

   /**
    * The F element of the matrix
    */
   SugRealType mF;

  public:
   /**
    * Returns the A element of the matrix
    */
    SugRealType getA();

   /**
    * Returns the B element of the matrix
    */
   SugRealType getB();

   /**
    * Returns the C element of the matrix
    */
   SugRealType getC();

   /**
    * Returns the D element of the matrix
    */
   SugRealType getD();

   /**
    * Returns the E element of the matrix
    */
   SugRealType getE();

   /**
    * Returns the F element of the matrix
    */
   SugRealType getF();

   /**
    * Sets the A element of the matrix
    */
   SugRealType setA(SugRealType newA);

   /**
    * Sets the B element of the matrix
    */
   SugRealType setB(SugRealType newB);

   /**
    * Sets the C element of the matrix
    */
   SugRealType setC(SugRealType newC);

   /**
    * Sets the D element of the matrix
    */
   SugRealType setD(SugRealType newD);

   /**
    * Sets the E element of the matrix
    */
   SugRealType setE(SugRealType newE);

   /**
    * Sets the F element of the matrix
    */
   SugRealType setF(SugRealType newF);

   /**
    * Sets the A, B, C, D, E, and F elements of the matrix
    */
   SugRealType setABCDEF(SugRealType newA, SugRealType newB, SugRealType newC, SugRealType newD, SugRealType newE, SugRealType newF);

   /**
    * Performs a multiply of two matrices
    */
   SugMatrix& multiply(SugMatrix& secondMatrix);

   /**
    * Performs the inverse of a matrix
    */
   SugMatrix& inverse();

   /**
    * Performs a translation of the matrix
    */
   SugMatrix& translate(SugRealType x, SugRealType y);

   /**
    * Performs a scale the matrix
    */
   SugMatrix& scale(SugRealType scaleFactor);

   /**
    * Performs a non-uniform scale of the matrix
    */
   SugMatrix& scaleNonUniform(SugRealType scaleFactorX, SugRealType scaleFactorY);

   /**
    * Performs a rotation of the matrix
    */
   SugMatrix& rotate(SugRealType angle);

   /**
    * Performs a rotation of the matrix with a given vector
    */
   SugMatrix& rotateFromVector(SugRealType x, SugRealType y);

   /**
    * Flips the x component of the matrix
    */
   SugMatrix& flipX();

   /**
    * Flips the y component of the matrix
    */
   SugMatrix& flipY();

   /**
    * Skews the x component of the matrix
    */
   SugMatrix& skewX(SugRealType angle);

   /**
    * Skews the y component of the matrix
    */
   SugMatrix& skewY(SugRealType angle);

   /**
    * The class constructor
    */
   SugMatrix();

   /**
    * The class constructor with helper initializations
    */
   SugMatrix(SugRealType newA, SugRealType newB, SugRealType newC, SugRealType newD, SugRealType newE, SugRealType newF);

   /**
    * The class destructor
    */
   ~SugMatrix();

};

#endif
